﻿using System;
using System.ComponentModel;
using System.Data;
using System.Windows;
using ReflectionStudio.Core.Events;
namespace WPFExcelReport
{
    public partial class TUBTKD02
    {
        public TUBTKD02()
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            MV = new VKDSTAMM();
            this.DataContext = MV;
            InitializeComponent();
        }
      
        public override void QueryCommand(object sender, RoutedEventArgs e)
        {
            try
            {
                
                dwData = TBMain.NewRow();
                dwData["KDMANDANT"] = app.Mandant;
                dwData["KDKUNDNR"] = " AND KDKUNDNR like '"+KUNDNR+"%'";
                dwData["KDKUNDNA"] = " AND (KDKUNDNA LIKE '%" + ART.Trim() + "%' ";
                dwData["KDNAME1"] = " or KDNAME1 LIKE '%" + ART.Trim() + "%') ";
                SResult = TMV.QueryKDSTAMM(dwData, 5);
                MergeData(SResult, false);
                IsSaved = false;
            }
            catch (Exception ex)
            {
                Tracer.Error(ex.StackTrace, ex);
            }
        } 
        
    }
}
